import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
/*
 * @Author: 檃
 * @Date: 2022-04-27 16:10:18
 * @LastEditTime: 2022-06-20 13:17:55
 * @Description:
 * @LastEditors: 檃
 */
import { useEffect } from 'react';
import { Route, Routes, useNavigate } from 'react-router';
import { configs } from './configs';
const Redirect = ({ to }) => {
    const navigate = useNavigate();
    useEffect(() => {
        navigate(to);
    });
    return null;
};
const RouteList = () => {
    return (_jsxs(Routes, { children: [configs.map((item) => {
                const Comp = item.component;
                return (_jsx(Route, { path: item.path, element: _jsx(Comp, {}) }, item.path));
            }), _jsx(Route, { path: "/*", element: _jsx(Redirect, { to: "/package-board" }) })] }));
};
export default RouteList;
